package com.example.boot.controller.Login;

import com.example.boot.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author laz
 * @date 2022/09/09 14:58
 */
@RestController
@RequestMapping("/user")
public class LoginController {

    @Autowired
    private IUserService userService;

    /**
     * 登录
     * @param user
     * @return
     */
    @PostMapping("/login")
    public LoginDto login(@RequestBody User user){
        LoginDto login = userService.login(user);
        return login;
    }


    /**
     * 测试
     * @return
     */
    @RequestMapping("/test")
    public Object test(){
        return "访问成功!";
    }

}
